package com.commons.dbutils.util;
/**
 * SQL工具类
 *
 */
public final class SQLUtils {
		
		public static final String SELECT_COUNT="select count(1) column_1 from ";
		public static final String SELECT_ALL="select * from ";
		public static final String SELECT=" select ";
		
		public static final String ALL_COLUMN=" * ";
		
		public static final String SELECT_TMP_COLUMN=" column_1 ";
		
		public static final String COUNT=" count(1) ";
		
		public static final String FROM=" from ";
		public static final String WHERE = " where ";
		
		public static final String GROUP =" group by ";
		public static final String HAVING =" having ";
		
		public static final String SORT="  order by ";
		public static final String DESC=" desc ";
		
		public static final String LIMIT =" limit ";
		
		public static final String UPDATE="update ";
		public static final String INSERT ="insert into ";
		public static final String VALUES=" values ";
		public static final String DELETE_FROM ="delete from";
		
		public static final String SET=" set ";
		
		public static final String QUESTION ="?";
		
		public static final String LEFT_BRACKET="(";
		public static final String RIGHT_BRACKET=")";
		public static final String COMMA=",";
		
		public static final String EQ ="=";
		
		public static final String NE ="<>";
		public static final String LIKE =" like ";
		public static final String GT =">";
		public static final String LT ="<";
		public static final String LE ="<=";
		public static final String GE =">=";
		public static final String AND =" and ";
		public static final String OR =" or ";
		
		public static final String IN =" in ";
		
		public static String bulidPreparedStatement(int questionNumber){
			StringBuffer buffer = new StringBuffer();
			for(int i=0;i<questionNumber;i++){
				buffer.append(QUESTION);
				if((i+1)!=questionNumber){
					buffer.append(COMMA);
				}
				
			}
			return buffer.toString();
		} 
		
}